home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * SetUpA5.h
- *
- * Copyright (c) 1991 Symantec Corporation. All rights reserved.
- *
- * This defines "SetUpA5()" and "RestoreA5()" routines that will work
- * in all A5-based projects.
- *
- * "RememberA5()" must be called in advance to
- * store away the value of A5 where it can be found by "SetUpA5()".
- * The matching calls to "RememberA5()" and
- * "SetUpA5()" *MUST* occur in the same file.
- *
- * Note that "RememberA5()", "SetUpA5()", and
- * "RestoreA5()" are not external. Each file that uses them must
- * include its own copy.
- *
- * If this file is used in the main file of a code resource with
- * "Custom Headers", be sure to #include it *AFTER* the custom
- * header! Otherwise, the code resource will begin with the code
- * for the function "__GetA5()", defined below.
- *
- */
-
-
- static void
- __GetA5(void)
- {
- asm {
- bsr.s @1
- dc.l 0 ; store A5 here
- @1 move.l (sp)+,a1
- }
- }
-
-
- #define RememberA5() do { __GetA5(); asm { move.l a5,(a1) } } while (0)
- #define SetUpA5() do { asm { move.l a5,-(sp) } __GetA5(); asm { move.l (a1),a5 } } while (0)
- #define RestoreA5() do { asm { move.l (sp)+,a5 } } while (0)
-